<script setup lang="ts">

const props = defineProps({
  onClick: {
    type: Function as () => void | Function,
    required: false,
  },
  btnName: {
    type: String,
    required: false,
    default: "Refresh"
  },
  loading:{
    type: Boolean,
    required: false,
    default: false
  }
})
</script>

<template>
  <div class="PyBtn_container">
    <div class="PyBtn" v-if="!loading">
      <!--    <el-button class="PyBtn" type="primary" round :icon="Refresh" @click="props.onClick">{{props.btnName}}-->
      <!--  </el-button>-->
      <a href="#" @click="props.onClick" >{{props.btnName}}</a>
    </div>
    <InputLoading1 v-if="loading"/>
  </div>
</template>

<style scoped>

.PyBtn_container {
  display: flex;
  position: relative;
  flex-wrap: wrap;
  justify-content: space-around;
  width: 220px;
  height: 50px;
  --sopt-width: 20px;
  --sopt-height: 15px;
  --sopt-radius: 15px;
}

.PyBtn_container .PyBtn {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0;
  top: 0;
  left: 0;
  width: 100%;
  height: 45px;
}

.PyBtn_container .PyBtn a {
  position: absolute;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  background: rgba(255, 255, 255, 0.05);
  color: #000000;
  box-shadow: 0 15px 15px rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  border-top: 1px solid rgba(255,255,255,0.1);
  backdrop-filter: blur(15px);
  border-radius: 30px;
  text-decoration: none;
  letter-spacing: 1px;
  overflow: hidden;
  font-weight: 400;
  z-index: 1;
  transition: 0.5s;
}

.PyBtn_container .PyBtn:hover a {
  letter-spacing: 5px;
}

.PyBtn_container .PyBtn a::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 50%;
  height: 100%;
  background: linear-gradient(to left, rgba(63, 149, 197, 0.5), transparent);
  transform: skewX(45deg) translate(0);
  transition: 0.5s;
}

.PyBtn_container .PyBtn:hover a::before {
  transform: skewX(45deg) translate(130px);
}

.PyBtn_container .PyBtn::before {
  content: "";
  position: absolute;
  background: #f00;
  width: var(--sopt-width);
  height: var(--sopt-height);
  left: 50%;
  bottom: -10%;
  transform: translate(-50%);
  border-radius: var(--sopt-radius);
  transition: 0.5s;
  transition-delay: 0.1s;
}

.PyBtn_container .PyBtn:hover::before {
  bottom: -10%;
  width: 55%;
  height: 45%;
  opacity: 0.7;
  border-radius: 30px;
}

.PyBtn_container .PyBtn::after {
  content: "";
  position: absolute;
  background: #f00;
  width: var(--sopt-width);
  height: var(--sopt-height);
  left: 50%;
  top: -5%;
  transform: translate(-50%);
  border-radius: var(--sopt-radius);
  transition: 0.5s;
  transition-delay: 0.1s;
}

.PyBtn_container .PyBtn:hover::after {
  top: -0px;
  width: 55%;
  height: 45%;
  opacity: 0.7;
  border-radius: 30px;
}

.PyBtn_container .PyBtn::after,
.PyBtn_container .PyBtn::before {
  box-shadow: 0 0 5px #f00,
  0 0 5px #f00,
  0 0 15px #f00,
  0 0 30px #f00;
}


</style>